NIELIT O Level Exam

What will be the output of the following Python functions?

x=3

eval('x^2')

What will be the output of the following Python functions?

x=3

eval('x^2')



निम्नलिखित Python कार्यों का आउटपुट क्या होगा?

A. Error एरर

B. 1

C. 9

D. 6




Correct Answer is :

B. 1



Explanation
The function eval is use to evaluate the expression that it takes as an argument. In the above case, the eval() function is used to perform XOR operation between 3 and 2. Hence the output is 1.
CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad